package edu.gyc.hiseckill.model;

import lombok.Data;

@Data
public class CommonReturnType {
    //return success fail
    private String status;

    //if status=success ,data为真实数据
    //if status=fail ,data为通用的错误码格式
    private Object data;

    public static CommonReturnType create(Object result,String status) {
        CommonReturnType commonReturnType=new CommonReturnType();
        commonReturnType.setData(result);
        commonReturnType.setStatus(status);
        return commonReturnType;
    }

    public static CommonReturnType create(Object result) {
        return CommonReturnType.create(result, "success");
    }
}
